import pymysql

# 外呼数据库
def connect_outbound():
    """数据库连接"""
    try:
        db = pymysql.connect(
            host='39.97.216.76',
            port=3306,
            user='zb_outbound',
            password='zb_outbound',
            db='zb_outbound',
            charset='utf8'
        )

        return db
    except Exception as e:
        print(e)
        return 500

# crm数据库
def connect_crm():
    try:
        db = pymysql.connect(
            # 连接数据库
            host='39.97.216.76',
            port=3306,
            user='zb_crm_test',
            password='zb_crm_test',
            db='zb_crm_test',
            charset='utf8',
        )
        return db
    except Exception as e:
        print(e)
        return 500

# BOSS数据库
def connect_boss():
    try:
        db = pymysql.connect(
            # 连接备份数据库
            # host='172.17.122.150',
            host='39.97.216.76',
            port=3306,
            user='zb_boss_test',
            password='zb_boss_test',
            db='zb_boss_test',
            charset='utf8',
        )
        return db
    except Exception as e:
        print(e)
        return 500